package com.jhs.kjs.robot;

import com.jhs.kjs.robot.core.ECoord2AddrBatch;

public class Coord2AddrThread extends Thread {
	private ECoord2AddrBatch batch;

	private boolean started = false;
	private boolean goRun = true;
	private int sleepTime = 1 * 60 * 1000;

	public boolean isStarted() {
		return started;
	}

	public void setStarted(boolean started) {
		this.started = started;
	}

	public int getSleeptime() {
		return sleepTime;
	}

	public void setSleepTime(int sleepTime) {
		this.sleepTime = sleepTime;
	}

	@Override
	public void run() {
		try {

			while (goRun) {
				batch.doJob();
				Thread.sleep(getSleeptime());
			}
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public void setBatch(ECoord2AddrBatch batche) {
		this.batch = batche;
	}
}
